'use strict';
const db = uniCloud.database();

exports.main = async (event, context) => {
  //event为客户端上传的参数
  let {
    category_id,
    num,
    size
  } = event
  // console.log(num, size, category_id);
  let res = await db.collection("zhumuta-cash-info")
    .where({
      category_id,
      article_status: 1
    })
    .orderBy('create_time', "desc")
    .skip((num - 1) * size)
    .limit(size)
    .get()

  //返回数据给客户端
  return res
};